#include<stdio.h>
#include<graphics.h>
#include<conio.h>

int main()
{
	float pi=3.14159;
	initgraph(1200,800);//create a window
	setbkcolor(WHITE);
	cleardevice();

	int centerX=300;
	int centerY=300;
	int r=200;

	int left;
	int top;
	int right;
	int bottom;

	int i;
	float angle;
	float totalangle=0;

	float h=rand()%180;
	COLORREF color1=HSVtoRGB(h,0.9,0.8);
	COLORREF color2=HSVtoRGB(h+180,0.9,0.8);
	while(1)
	{
		for(centerX=200;centerX<1200;centerX+=400)
		{
			for(centerY=200;centerY<800;centerY+=400)
			{
				for(r=200;r>0;r-=50)
				{
					left=centerX-r;
					top=centerY-r;
					right=centerX+r;
					bottom=centerY+r;
	
					for(i=0;i<20;i++)
					{
						angle=i*pi/10+totalangle;
						setfillcolor(color1);
						solidpie(left,top,right,bottom,angle,2*pi/60+angle);
						setfillcolor(RGB(220,200,123));
						solidpie(left,top,right,bottom,2*pi/60+angle,3*pi/60+angle);
						setfillcolor(color2);
						solidpie(left,top,right,bottom,3*pi/60+angle,4*pi/60+angle);
						setfillcolor(RGB(0,0,0));
						solidpie(left,top,right,bottom,4*pi/60+angle,5*pi/60+angle);
					}
					totalangle+=20;
				}
			}
		}
		_getch();
	}
	return 0;
}